package book

import (
	"NovelBook/dao"
	"NovelBook/models/db_models"
)

func CreateBooks(books []db_models.Books) error {
	err := dao.GetDb().Create(&books).Error
	if err != nil {
		return err
	}
	return nil
}

// UpdateBooks 更新书籍
func UpdateBooks(books db_models.Books) error {
	err := dao.GetDb().Save(&books).Error
	if err != nil {
		return err
	}
	return nil
}
